package demo2;

import java.util.ArrayList;
import java.util.List;

public class Text {
    public static void main(String[] args) {
        CardGame cardGame = new CardGame();
        List<card> cards = cardGame.buyCard();
        System.out.println("洗牌前");
        System.out.println(cards);
        System.out.println("洗牌后");
        List<card> cards1 = cardGame.shuffle(cards);
        System.out.println(cards1);

        List<card> head1 = new ArrayList<>();
        List<card> head2 = new ArrayList<>();
        List<card> head3 = new ArrayList<>();
        List<List<card>> ccards = new ArrayList<>();
        ccards.add(head1);
        ccards.add(head2);
        ccards.add(head3);
        for(int i = 0 ; i < 5 ; i++){
            for(int j = 0 ; j < 3 ; j++){
                card card = cards1.remove(0);
                ccards.get(j).add(card);
            }
        }
        System.out.println(ccards);
    }



}
